<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<LINK REL="stylesheet" TYPE="text/css" HREF="<?php echo base_url()?>css/estilos.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Refresh" content="240"> 
 <!--Load the AJAX API-->
 <script type="text/javascript" src="https://www.google.com/jsapi"></script>
 <script src="<?php echo base_url()?>/public/jquery.min.js" type="text/javascript"></script>
 <script type="text/javascript">
 
// Load the Visualization API and the piechart package.
 google.load('visualization', '1', {'packages':['corechart']});
 
// Set a callback to run when the Google Visualization API is loaded.
 google.setOnLoadCallback(drawChart);
 
function drawChart() {
 var jsonData = $.ajax({
 url:'<?php echo base_url().'grafica/getDataTempyHum'?>', //another controller function for generating data
 mtype : "post", //Ajax request type. It also could be GET
 dataType:"json",
 async: false
 }).responseText;
 
// Create our data table out of JSON data loaded from server.
 var data = new google.visualization.DataTable(jsonData);
 
// Instantiate and draw our chart, passing in some options.
 var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
 chart.draw(data,{
                  width: 760, height: 460,
                  vAxis: {maxValue: 45, minValue: 0}});
 }
 
</script>
  
<title>Gráficas.</title>
</head>
<body>

<div class="container">
  <div class="header"><a href=""><img src="<?php echo base_url('public/img/logo.jpg')?>" alt="Insertar logotipo aquí" name="Insert_logo" width="180" height="90" id="Insert_logo" style="background-color: #C6D580; display:block;" /></a> 
    <!-- end .header --></div>
  <div class="sidebar1">
    <ul class="nav">
	
      <li><?php echo anchor($menuusuarios,'Menu Usuarios.');?></li>
      <li><?php echo anchor('consultas','Consultas.');?></li>
      <li><?php echo anchor('alarmas','Alarmas.');?></li>
      <li><?php echo anchor('actuadores/estableceHumedad','Actuadores.');?></li>
      <li><?php echo anchor('login/cerrarsesion','Cerrar sesión.');?></li>
      
    </ul>
      <p><h2>Estado.</h2></p>
    <p><?php echo $estadot ;?></p>
    <p>Valor: <?php echo $valtemp ;?>º +-<?php echo $errort ;?></p>
    
    <p><?php echo $estadoh ;?></p>
    <p>Valor: <?php echo $valhum ;?>% +-<?php echo $errorh ;?></p>
    
    
    <p><?php echo $estadoc ;?></p>
    <p><?php echo $estador ;?></p>
    
 
    <!-- end .sidebar1 --></div>
  <div class="content">
    <h1>Gráficas.</h1>
    
    
    <div id="chart_div"></div>
     
    
